home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Disc to the Future 2
/
Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin
/
MAC
/
THINKC
/
3_0
/
PSPRT__
/
MAIN.C
< prev
next >
Wrap
Text File
|
1988-12-14
|
2KB
|
73 lines
/* PostScript Printer DA
- John Jeppson
This projects builds a desk accessory which will send a PostScript source text
to the LaserWriter. The DA uses the standard file dialog to select a TEXT file
which must contain a valid PostScript language program.
Unfortunately, since PostScript syntax error messages cannot be recovered from
the LaserWriter driver, your only indication of an error in the PostScript program
will be failure to print.
NOTE: when writing your PostScript program:
1. Don't call "showpage". QuickDraw will do that for you at the end.
2. QuickDraw initializes the PostScript transfer matrix so that y increases
downward in the usual Macintosh manner. If you want to use standard
PostScript directions (y increases upward) then bracket your PostScript
program with:
gsave initmatrix
----
grestore
The file "Circle of Adobe" contains a PostScript Demo.
For further information about PostScript try:
Texts:
"PostScript Language Tutorial and Cookbook" - Adobe Systems, Inc.
"PostScript Language Reference Manual" - Adobe Systems, Inc.
PostScript Editor Programs: (available from APDA)
"PostHaste" - Micro Dynamics, Ltd.
"Lasertalk" - Emerald City Software
*/
/* the DA routines */
void doOpen (devCtlEnt)
DCtlPtr devCtlEnt;
{
if (devCtlEnt->dCtlStorage != 0)
sendPostScript();
else
SysBeep (3); /* just abort if we have no storage */
CloseDriver (devCtlEnt->dCtlRefNum);
}
main (paramBlock, devCtlEnt, n)
cntrlParam *paramBlock;
DCtlPtr devCtlEnt;
int n;
{
switch (n) {
case 0: /* Open - does it all in this DA */
doOpen (devCtlEnt);
break;
case 1: /* Prime */
case 2: /* Control */
case 3: /* Status */
case 4: /* Close */
break;
}
return 0;
}